﻿<div class="home-page">
    <div class="wkf-nav-left">
        <div>
            <h3>我的公文</h3>
            <ul>
                <li ng-class="{'selected' : pageConfig.activeNav === 'needDo'}"><a ng-click="onChangeTemplate('needDo')">待处理的公文</a></li>
                <li ng-class="{'selected' : pageConfig.activeNav === 'iDone'}"><a ng-click="onChangeTemplate('iDone')">已处理过的公文</a></li>
                <li ng-class="{'selected' : pageConfig.activeNav === 'mineDoing'}"><a ng-click="onChangeTemplate('mineDoing')">我发出的未完成公文</a></li>
                <li ng-class="{'selected' : pageConfig.activeNav === 'mineDone'}"><a ng-click="onChangeTemplate('mineDone')">我发出的已完成公文</a></li>
                <!--<li ng-class="{'selected' : pageConfig.activeNav === 'iStop'}"><a ng-click="onChangeTemplate('iStop')">我终止的公文</a></li>-->
                <li ng-class="{'selected' : pageConfig.activeNav === 'mineDraft'}"><a ng-click="onChangeTemplate('mineDraft')">我的草稿</a></li>
            </ul>
        </div>
        <div>
            <h3>发起公文</h3>
            <ul>
                <li ng-repeat="item in wkfTempList"><a href="/Apps/Workflow/Running/Open?mid={{item.ID}}" target="_blank">{{ isDeptAdmin && item.Title === '下级来文办件'? '公文上报' : item.Title}}</a></li>
            </ul>
        </div>
    </div>
    <div class="main-area">
        <h2>共有{{paginationConf.totalItems}}条{{pageHeader[pageConfig.activeNav]}}</h2>
        <div class="search">
            <div class="search-condition">
                <div class="form-inline">
                    <div class="form-group">
                        <label for="lwwh">来文文号：</label>
                        <input type="text" class="form-control form-control-sm middle" id="lwwh" ng-model="pageSearch.DocumentNumber" ng-keyup="enterEvent($event)">
                    </div>
                    <div class="form-group">
                        <label for="title">公文标题：</label>
                        <input type="text" class="form-control form-control-sm large" id="title" ng-model="pageSearch.Title" ng-keyup="enterEvent($event)">
                    </div>
                    <div class="form-group">
                        <label for="sfwrq">收/发文日期：</label>
                        <input type="text" class="form-control select-date form-control-sm middle" id="sfwrq" readonly="readonly" ng-model="sfwrq">
                        <input type="text" class="hide" id="sfwrqStart" ng-model="pageSearch.StartClosedOrHairTime">
                        <input type="text" class="hide" id="sfwrqEnd" ng-model="pageSearch.EndClosedOrHairTime">
                    </div>
                    <!--<div class="form-group">
                <label for="swxl">收文序列：</label>
                <select class="form-control form-control-sm" id="swxl" ng-model="pageSearch.SequenceName">
                    <option value="{{null}}">全选</option>
                    <option ng-repeat="item in swxl" value="{{item.Name}}">{{item.Name}}</option>
                </select>
            </div>
            <div class="form-group">
                <label for="swxl">收文文号：</label>
                <input type="text" class="form-control form-control-sm" id="swxl" ng-model="pageSearch.SequenceNumber">
            </div>-->
                    <div ng-show="pageConfig.activeNav !== 'needDo'" class="form-group">
                        <label for="fqsj">发起时间：</label>
                        <input type="text" class="form-control select-date form-control-sm middle" id="fqsj" readonly="readonly" ng-model="fqsj">
                        <input type="text" class="hide" id="fqsjStart" ng-model="pageSearch.StartCreatedTime" />
                        <input type="text" class="hide" id="fqsjEnd" ng-model="pageSearch.EndCreatedTime" />
                    </div>
                    <div ng-show="pageConfig.activeNav === 'iStop'" class="form-group">
                        <label for="zzsj">终止时间：</label>
                        <input type="text" class="form-control select-date form-control-sm middle" id="zzsj" readonly="readonly" ng-model="zzsj">
                        <input type="text" class="hide" id="zzsjStart" ng-model="pageSearch.StartEndTime" />
                        <input type="text" class="hide" id="zzsjEnd" ng-model="pageSearch.EndEndTime" />
                    </div>
                    <div class="form-group">
                        <label for="wkfType">公文类型：</label>
                        <select class="form-control form-control-sm" id="wkfType" ng-model="pageSearch.WorkFlowId">
                            <option value="">全选</option>
                            <option ng-repeat="item in wkfDefaultTempList" value="{{item.ID}}">{{item.Title}}</option>
                        </select>
                    </div>
                </div>
            </div>

            <div class="search-action">
                <button type="submit" class="btn btn-default btn-sm btn-search" ng-click="onReset()">重置</button>
                <button type="submit" class="btn btn-info btn-sm btn-search" ng-click="onSearch()">查询</button>
            </div>
        </div>
        <table class="table">
            <thead>
                <tr>
                    <th ng-repeat="title in titleObj[pageConfig.activeNav]">{{title}}</th>
                </tr>
            </thead>
            <tbody>
                <tr ng-if="pageConfig.activeNav === 'needDo' && activeTableData.length > 0" ng-repeat="row in activeTableData">
                    <td>{{($index+1)+(pageSearch.PageNumber-1)*pageSearch.PageSize}}</td>
                    <td>{{row.MessageTitle}}</td>
                    <td>{{row.DocumentNumber || '----'}}</td>
                    <td title="{{row.DocumentTitle}}" class="item-lg">
                        <a class="text-info" href="/Apps/Workflow/Running/Open?mid={{row.MessageId}}" target="_blank">{{row.DocumentTitle || '----'}}</a>
                    </td>
                    <td>{{row.ClosedOrHairTime.split(' ')[0]}}</td>
                    <td>{{row.ReceiveTime | date:'yyyy-MM-dd HH:mm:ss'}}</td>
                    <td>{{row.InitiateEmplName | date:'yyyy-MM-dd HH:mm:ss'}}</td>
                    <td>{{row.MyTask}}</td>
                    <!--<td>{{row.SequenceName}}&nbsp;&nbsp;{{row.SequenceNumber}}</td>-->
                </tr>
                <tr ng-if="pageConfig.activeNav === 'iDone' && activeTableData.length > 0" ng-repeat="row in activeTableData">
                    <td>{{($index+1)+(pageSearch.PageNumber-1)*pageSearch.PageSize}}</td>
                    <td>{{row.MessageTitle}}</td>
                    <td>{{row.DocumentNumber || '----'}}</td>
                    <td title="{{row.DocumentTitle}}" class="item-lg">
                        <a class="text-info" href="/Apps/Workflow/Running/Open?mid={{row.MessageId}}" target="_blank">{{row.DocumentTitle || '----'}}</a>
                    </td>
                    <td>{{row.ClosedOrHairTime.split(' ')[0]}}</td>
                    <td>{{row.ReceiveTime | date:'yyyy-MM-dd HH:mm:ss'}}</td>
                    <td>{{row.CreateTime | date:'yyyy-MM-dd HH:mm:ss'}}</td>
                    <!--<td>{{row.SequenceName}}&nbsp;&nbsp;{{row.SequenceNumber}}</td>-->
                </tr>
                <tr ng-if="pageConfig.activeNav === 'mineDoing' && activeTableData.length > 0" ng-repeat="row in activeTableData">
                    <td>{{($index+1)+(pageSearch.PageNumber-1)*pageSearch.PageSize}}</td>
                    <td>{{row.MessageTitle}}</td>
                    <td>{{row.DocumentNumber || '----'}}</td>
                    <td title="{{row.DocumentTitle}}" class="item-lg">
                        <a class="text-info" href="/Apps/Workflow/Running/Open?mid={{row.MessageId}}" target="_blank">{{row.DocumentTitle || '----'}}</a>
                    </td>
                    <td>{{row.ClosedOrHairTime.split(' ')[0]}}</td>
                    <td>{{row.CreateTime | date:'yyyy-MM-dd HH:mm:ss'}}</td>
                    <td>{{row.MyTask}}</td>
                    <!--<td>{{row.SequenceName}}&nbsp;&nbsp;{{row.SequenceNumber}}</td>-->
                </tr>
                <tr ng-if="pageConfig.activeNav === 'mineDone' && activeTableData.length > 0" ng-repeat="row in activeTableData">
                    <td>{{($index+1)+(pageSearch.PageNumber-1)*pageSearch.PageSize}}</td>
                    <td>{{row.MessageTitle}}</td>
                    <td>{{row.DocumentNumber || '----'}}</td>
                    <td title="{{row.DocumentTitle}}" class="item-lg">
                        <a class="text-info" href="/Apps/Workflow/Running/Open?mid={{row.MessageId}}" target="_blank">{{row.DocumentTitle || '----'}}</a>
                    </td>
                    <td>{{row.ClosedOrHairTime.split(' ')[0]}}</td>
                    <td>{{row.CreateTime | date:'yyyy-MM-dd HH:mm:ss'}}</td>
                    <td>{{row.FinishTime | date:'yyyy-MM-dd HH:mm:ss'}}</td>
                    <!--<td>{{row.SequenceName}}&nbsp;&nbsp;{{row.SequenceNumber}}</td>-->
                </tr>
                <tr ng-if="pageConfig.activeNav === 'iStop' && activeTableData.length > 0" ng-repeat="row in activeTableData">
                    <td>{{($index+1)+(pageSearch.PageNumber-1)*pageSearch.PageSize}}</td>
                    <td>{{row.MessageTitle}}</td>
                    <td>{{row.DocumentNumber || '----'}}</td>
                    <td title="{{row.DocumentTitle}}" class="item-lg">
                        <a class="text-info" href="/Apps/Workflow/Running/Open?mid={{row.MessageId}}" target="_blank">{{row.DocumentTitle || '----'}}</a>
                    </td>
                    <td>{{row.ClosedOrHairTime.split(' ')[0]}}</td>
                    <td>{{row.CreateTime | date:'yyyy-MM-dd HH:mm:ss'}}</td>
                    <td>{{row.FinishTime | date:'yyyy-MM-dd HH:mm:ss'}}</td>
                    <!--<td>{{row.SequenceName}}&nbsp;&nbsp;{{row.SequenceNumber}}</td>-->
                </tr>
                <tr ng-if="pageConfig.activeNav === 'mineDraft' && activeTableData.length > 0" ng-repeat="row in activeTableData">
                    <td>{{($index+1)+(pageSearch.PageNumber-1)*pageSearch.PageSize}}</td>
                    <td>{{row.MessageTitle}}</td>
                    <td>{{row.DocumentNumber || '----'}}</td>
                    <td title="{{row.DocumentTitle}}" class="item-lg">
                        <a class="text-info" href="/Apps/Workflow/Running/Open?mid={{row.MessageId}}" target="_blank">{{row.DocumentTitle || '----'}}</a>
                    </td>
                    <td>{{row.ClosedOrHairTime.split(' ')[0]}}</td>
                    <td>{{row.CreateTime | date:'yyyy-MM-dd HH:mm:ss'}}</td>
                    <td>{{row.CreateTime | date:'yyyy-MM-dd HH:mm:ss'}}</td>
                    <!--<td>{{row.SequenceName}}&nbsp;&nbsp;{{row.SequenceNumber}}</td>-->
                </tr>
                <tr ng-if="!activeTableData.length">
                    <td colspan="{{titleObj[pageConfig.activeNav].length}}">无【{{pageHeader[pageConfig.activeNav]}}】</td>
                </tr>
            </tbody>
        </table>
        <tm-pagination conf="paginationConf"></tm-pagination>
    </div>
</div>
<div id="dlg-date-selector" class="div-dlg">
    从：<input type="text" id="date-from" class="date-value" /><br />
    <br />
    至：<input type="text" id="date-to" class="date-value" />
</div>
